package com.example.demo.dao;

import com.example.demo.entity.clas;
import com.example.demo.entity.crose;
import com.example.demo.entity.discourage;
import com.example.demo.entity.user;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface a {
    @Select("SELECT * FROM `user` WHERE NAME=#{name} AND pwd=#{pwd};")
    user getuser(String name,String pwd);
    @Insert("INSERT INTO `user`(`name`,pwd) VALUE(#{name},#{pwd});")
    boolean adduser(String name,String pwd);
    @Select("SELECT `name` FROM crose WHERE `type`=#{type};")
    List<String> getcname(String type);
    @Select("SELECT * FROM crose;")
    List<crose> getc();
    @Select("SELECT clas FROM clas WHERE cid=#{cid};")
    List<clas> getclas(int cid);
    @Select("SELECT u.name ,d.say FROM `user` u,discourage d WHERE d.uid=u.id AND d.cid=#{cid};")
    List<discourage> getd(int cid);


    
}
